<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/templates/common.xhtml">
    <ui:define name="title">Вход в систему</ui:define>
    <ui:define name="content">
        <h1>Вход на сайт</h1>

        <h:messages/>

        <h:form prependId="false">
            <h:panelGrid columns="2">
                <f:validateBean>
                    <h:outputLabel for="j_username" value="Имя пользователя (логин):"/>
                    <h:inputText id="j_username" required="true"/>

                    <h:outputLabel for="j_password" value="Пароль:"/>
                    <h:inputSecret id="j_password" required="true"/>

                    <h:selectBooleanCheckbox id="_spring_security_remember_me">Запомнить меня</h:selectBooleanCheckbox>
                </f:validateBean>
            </h:panelGrid>

            <h:commandButton action="#{authenticationBean.doLogin}" value="Войти" id="login"/>
        </h:form>
        <h:link outcome="/register.xhtml" rendered="#{facesContext.externalContext.userPrincipal == null}">
            Зарегистрироваться
        </h:link>
    </ui:define>
</ui:composition>
</html>
